package com.example.demo2.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;

import com.alibaba.fastjson.JSON;


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.util.IOUtils;
import com.example.demo2.dao.JsonReader;
import com.example.demo2.entity.Passenger;
import com.example.demo2.framework.IOCMinimalistImitationVersion.Component;
import lombok.Data;

@Data
@Component
public class Json2ObjectUtil {

    List<Passenger> Passenger = new LinkedList<>();



    public  void Json2Object(){
        String path = JsonReader.class.getClassLoader().getResource("json/PassengerData.json").getPath();
        String s = JsonReader.readJsonFile(path);
        JSONObject passenger = JSON.parseObject(s);
        Passenger= JSON.parseArray(s, Passenger.class);
        String name = passenger.getString("");

    }


}
